<template>
	<view class="control-page">
		<scroll-view scroll-y="true">

			<uni-card>
				<div slot='cover' class='cover-box'>
					<div class="box">
						<index :isDisplay='true' :configureData="indexData"></index>
					</div>
				</div>
				<text class="uni-body">我的页:/pages/index/index</text>
				<view slot="actions" class="card-actions">
					<u-button type="primary" @click="goIndex" text="配置该页"></u-button>
				</view>
			</uni-card>

			<uni-card>
				<div slot='cover' class='cover-box'>
					<div class="box">
						<window :isDisplay='true' :configureData="windowData"></window>
					</div>
				</div>
				<text class="uni-body">橱窗页:/pages/window/window</text>
				<view slot="actions" class="card-actions">
					<u-button type="primary" @click="goWindow" text="配置该页"></u-button>
				</view>
			</uni-card>

			<uni-card>
				<div slot='cover' class='cover-box'>
					<div class="box">
						<commission :isDisplay='true' :configureData="commissionData"></commission>
					</div>
				</div>
				<text class="uni-body">佣金页:/pages/commission/commission</text>
				<view slot="actions" class="card-actions">
					<u-button type="primary" @click="goCommission" text="配置该页"></u-button>
				</view>
			</uni-card>

			<uni-card>
				<div slot='cover' class='cover-box'>
					<div class="box">
						<withdrawal :isDisplay='true' :configureData="withdrawalData"></withdrawal>
					</div>
				</div>
				<text class="uni-body">提现记录页:/pages/withdrawal/withdrawal</text>
				<view slot="actions" class="card-actions">
					<u-button type="primary" @click="goWithdrawal" text="配置该页"></u-button>
				</view>
			</uni-card>

		</scroll-view>
	</view>
</template>

<script>
	import index from "@/pages/index/index.vue"
	import window from "@/pages/window/window.vue"
	import commission from "@/pages/commission/commission.vue"
	import withdrawal from "@/pages/withdrawal/withdrawal.vue"
	import { dataBaseMixin } from "@/mixins/dataBaseMixin.js"
	export default {
		mixins:[dataBaseMixin],
		components: {
			index,
			window,
			commission,
			withdrawal,
		},
		data() {
			return {
				indexData: {},
				windowData: {},
				commissionData: {},
				withdrawalData: {},
			};
		},
		onLoad() {
			this.getAllData()
		},
		methods: {
			goIndex() {
				uni.navigateTo({
					url: '/pages/control/index'
				})
			},
			goWindow() {
				uni.navigateTo({
					url: '/pages/control/window'
				})
			},
			goCommission() {
				uni.navigateTo({
					url: '/pages/control/commission'
				})
			},
			goWithdrawal() {
				uni.navigateTo({
					url: '/pages/control/withdrawal'
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	.control-page {
		.cover-box {
			border: 2px dashed #666;
			overflow: hidden;
			height: 200px;
			padding: 10px;

			.box {
				border-radius: 10px;
				height: 200px;
				overflow: scroll;
			}
		}

		::v-deep .uni-card {
			padding: 15px !important;
		}
	}
</style>
